home *** CD-ROM | disk | FTP | other *** search
-
- PEEKs, POKEs, AND SYSes -- Part 27
- -- continued from Part 26 --
-
-
-
-
- Arrays start at VARTAB and end at
-
- STREND. Before you dimension your
-
- first array, VARTAB and STREND both
-
- point to the same location -- the end
-
- of simple arrays. Each time you use a
-
- new BASIC array, it gets built at
-
- STREND, and then STREND is changed to
-
- point to the end of that new array.
-
- There's really no way to explain the
-
- structure of arrays without resorting
-
- to charts, so here they come!!! Note
-
- well that the arrays start at the
-
- TOP of the chart, and as you read down
-
- the memory addresses get higher. This
-
- is the reverse of the convention I
-
- have been using. If the meaning of
-
- the chart isn't immediately clear to
-
- you, try reading the explanations that
-
- follow it.
-
-
- ARYTAB points to the beginning of
-
- the first array. All arrays are
-
- organized like this:
-
-
- A. Two bytes for the name
-
- B. Two bytes for an index to the
- next variable name.
-
- C. One byte to tell how many
- dimensions.
-
- D. Two bytes for each dimension to
- tell how many elements each
- dimension has
-
- E. The actual array variables
-
-
- Every array has these five areas,
-
- as charted below:
-
-
- ======================================
- CHART 2:
- What arrays look like in general.
- --------------------------------------
- purpose of area size of area
-
- +----------+
- A !name ! always 2 bytes
- +----------+
- B !offset to ! always 2 bytes
- !next array!
- !name !
- +----------+
- C !number of ! always 1 byte
- !dimensions!
- +----------+
- D !sizes of ! always 2 bytes per
- !dimensions! dimension
- +----------+
- E !variables ! size varies with
- ! ! variable type and
- +----------+ size of dimensions
- ======================================
-
- -------< continued in Part 28 >-------
-